﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using f1mua.com.Models;

namespace f1mua.com.Controllers
{
    public class HomeController : Controller
    {
        DB_NuocHoaMPEntities db = new DB_NuocHoaMPEntities();

        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";

            return View();
        }
        public ActionResult Home()
        {
            string Chuoi = "";
            var product = (from p in db.Products orderby p.Id descending select p).Take(8).ToList();
            for (int i = 0; i < product.Count; i++)
            {
                 // Chuoi +="<div class=\"mathang_new1\">";
                 //       Chuoi +="<div class=\"mathang1\">";
                 //           Chuoi +=" <a href=\"/Product/Chitietsanpham\"><img src=\""+ product[i].Image +"\" /></a>";
                 //       Chuoi +=" </div>";
                 //        Chuoi +="<a href=\"/Product/Chitietsanpham\">"+product[i].Name+" </a>";
                 //        Chuoi +="<P>Giá:"+product[i].PiceOld+"</P>";
                 //         Chuoi +="<div class=\"button\">";
                 //            Chuoi +="<input class=\"datmua\" type=\"button\" value=\"\" />";
                 //            Chuoi +="<input class=\"muachung\" type=\"button\" value=\"\" />";
                 //         Chuoi +="</div>";
                 //Chuoi += "</div>";
                    //Chuoi +="<div class=\"border1\" ></div>";
                    // Chuoi +="<div class=\"border2\" ></div>";
                    // Chuoi +="<div class=\"border3\" ></div>";
               
            }
            ViewBag.View = Chuoi;
            return View();
        }
       
        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
    }
}
